function indexStruct=get_indexStruct(identifier,varargin)
%Returns the available indicies for the curvelet transformation :
        % the i-th entry contains the number of available angular scales for the
        % i-th radial scale.
        % length(indexStruct) corresponds to the number of available radial
        % scales.
%
%
%author: Sebastian Schmelcher version: 2012-05-10

%identifier recognision
if(iscell(identifier))
   identifier=identifier{1};
end


[id,subId]=strtok(identifier,'_');
switch id        
    case 'mycandes'                
        Ind_rad=round(log2(max(varargin{1})));
        %theoretically ceil should be used instead of round
        %but this leads to extremely small last scale curvelet windows only
        %visible in the corners in case of diadic image sizes.  
        indexStruct=8*2.^floor(0.0:0.5:((Ind_rad-2)/2));
  
    case 'limitedAngle'
        [id,subId]=strtok(subId,'_');
        switch id
            case 'innerFading'
                lim_angl=str2double(strtok(subId,'_'));
                indexStruct=2*ceil(lim_angl/360.*get_indexStruct('mycandes',varargin{1}));
            case 'outerFading'
                lim_angl=str2double(strtok(subId,'_'));
                indexStruct=2*ceil(lim_angl/360.*get_indexStruct('mycandes',varargin{1}));
            case 'fixedFading'
                pieces=str2double(strtok(subId,'_'));
                indexStruct=2*pieces*ones(1,length(get_indexStruct('mycandes',varargin{1})));
            otherwise
                indexStruct={};
        end
        
    otherwise
        indexStruct={};
end
% 
% if(length(identifier)>12)
%     if(strcmp(identifier(1:12),'limitedAngle')||strcmp(identifier(1:12),'limitedangle'))
%         sub_id=identifier(14:24);
%         switch sub_id
%             case 'innerFading'
%                 lim_angl=str2double(identifier(26:end));
%                 indexStruct=2*ceil(lim_angl/360.*get_indexStruct('mycandes',varargin{1}));
%             case 'outerFading'
%                 lim_angl=str2double(identifier(26:end));
%                 indexStruct=2*ceil(lim_angl/360.*get_indexStruct('mycandes',varargin{1}));
%             case 'fixedFading'
%                 pieces=str2double(identifier(26));
%                 indexStruct=2*pieces*ones(1,log2(max(varargin{1})));
%             otherwise
%                 indexStruct={};
%         end
%     end
%     
% end